package fr.utt.lo02.CrazyEights.model.players;

import java.io.Serializable;
import java.util.Random;

import fr.utt.lo02.CrazyEights.model.strategies.Strategy;
import fr.utt.lo02.CrazyEights.model.strategies.StrategyBalance;
import fr.utt.lo02.CrazyEights.model.strategies.StrategyRandom;
import fr.utt.lo02.CrazyEights.model.strategies.StrategyScore;


/**
 * Represents a human player
 * @author Jeremy
 *
 */
public class Human extends Player implements Serializable{
	
	private static final long serialVersionUID = 1L;

	/**
	 * Create the human player
	 * @param name name wanted for the player
	 */
	public Human(String name){
		super(name);
	}
	
	/**
	 * set a strategy and play a card using this strategy.
	 */
	public void play(){
		Strategy strat;
		Random rand = new Random();
		int min = 0;
		int max = 2;
		int randomStrat = rand.nextInt(max-min+1)+min;
		switch(randomStrat){
		case 0:
			strat =new StrategyRandom();
			break;
		case 1:
			strat = new StrategyBalance();
			break;
		case 2:
			strat = new StrategyScore();
			break;
		default:
			strat = new StrategyRandom();
		}
		play(strat.play(this));
	}
	
	/**
	 * do nothing for human players
	 */
	public void chooseSuit(){
	}
	
	public String toString() {
		return "[H] "+getName();
	}
}
